home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 April: Mac OS SDK / Dev.CD Apr 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / PInterfaces / CTBUtilities.p < prev    next >
Encoding:
Text File  |  1996-09-11  |  5.5 KB  |  231 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        CTBUtilities.p
  3.  
  4.      Contains:    Communications Toolbox Utilities interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.1.4
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. }
  19.  
  20. {$IFC UNDEFINED UsingIncludes}
  21. {$SETC UsingIncludes := 0}
  22. {$ENDC}
  23.  
  24. {$IFC NOT UsingIncludes}
  25.  UNIT CTBUtilities;
  26.  INTERFACE
  27. {$ENDC}
  28.  
  29. {$IFC UNDEFINED __CTBUTILITIES__}
  30. {$SETC __CTBUTILITIES__ := 1}
  31.  
  32. {$I+}
  33. {$SETC CTBUtilitiesIncludes := UsingIncludes}
  34. {$SETC UsingIncludes := 1}
  35.  
  36.  
  37. {$IFC UNDEFINED __MEMORY__}
  38. {$I Memory.p}
  39. {$ENDC}
  40. {    Types.p                                                        }
  41. {        ConditionalMacros.p                                        }
  42. {    MixedMode.p                                                    }
  43.  
  44. {$IFC UNDEFINED __DIALOGS__}
  45. {$I Dialogs.p}
  46. {$ENDC}
  47. {    Errors.p                                                    }
  48. {    Menus.p                                                        }
  49. {        Quickdraw.p                                                }
  50. {            QuickdrawText.p                                        }
  51. {    Controls.p                                                    }
  52. {    Windows.p                                                    }
  53. {        Events.p                                                }
  54. {            OSUtils.p                                            }
  55. {    TextEdit.p                                                    }
  56.  
  57. {$IFC UNDEFINED __STANDARDFILE__}
  58. {$I StandardFile.p}
  59. {$ENDC}
  60. {    Files.p                                                        }
  61. {        Finder.p                                                }
  62.  
  63. {$IFC UNDEFINED __APPLETALK__}
  64. {$I AppleTalk.p}
  65. {$ENDC}
  66.  
  67. {$PUSH}
  68. {$ALIGN MAC68K}
  69. {$LibExport+}
  70.  
  71. CONST
  72. {    version of Comm Toolbox Utilities    }
  73.     curCTBUVersion                = 2;
  74. {    Error codes/types    }
  75.     ctbuGenericError            = -1;
  76.     ctbuNoErr                    = 0;
  77.  
  78.     
  79. TYPE
  80.     CTBUErr = OSErr;
  81.  
  82.  
  83. CONST
  84.     chooseDisaster                = -2;
  85.     chooseFailed                = -1;
  86.     chooseAborted                = 0;
  87.     chooseOKMinor                = 1;
  88.     chooseOKMajor                = 2;
  89.     chooseCancel                = 3;
  90.  
  91.     
  92. TYPE
  93.     ChooseReturnCode = INTEGER;
  94.  
  95.  
  96. CONST
  97.     nlOk                        = 0;
  98.     nlCancel                    = 1;
  99.     nlEject                        = 2;
  100.  
  101.     
  102. TYPE
  103.     NuLookupReturnCode = INTEGER;
  104.  
  105.  
  106. CONST
  107.     nameInclude                    = 1;
  108.     nameDisable                    = 2;
  109.     nameReject                    = 3;
  110.  
  111.     
  112. TYPE
  113.     NameFilterReturnCode = INTEGER;
  114.  
  115.  
  116. CONST
  117.     zoneInclude                    = 1;
  118.     zoneDisable                    = 2;
  119.     zoneReject                    = 3;
  120.  
  121.     
  122. TYPE
  123.     ZoneFilterReturnCode = INTEGER;
  124.  
  125.     DialogHookProcPtr = ProcPtr;  { FUNCTION DialogHook(item: INTEGER; theDialog: DialogPtr): INTEGER; }
  126.     DialogHookUPP = UniversalProcPtr;
  127.  
  128. CONST
  129.     uppDialogHookProcInfo = $000003A0; { FUNCTION (2 byte param, 4 byte param): 2 byte result; }
  130.  
  131. FUNCTION NewDialogHookProc(userRoutine: DialogHookProcPtr): DialogHookUPP;
  132.     {$IFC NOT GENERATINGCFM }
  133.     INLINE $2E9F;
  134.     {$ENDC}
  135.  
  136. FUNCTION CallDialogHookProc(item: INTEGER; theDialog: DialogPtr; userRoutine: DialogHookUPP): INTEGER;
  137.     {$IFC NOT GENERATINGCFM}
  138.     INLINE $205F, $4E90;
  139.     {$ENDC}
  140.  
  141. CONST
  142. {    Values for hookProc items        }
  143.     hookOK                        = 1;
  144.     hookCancel                    = 2;
  145.     hookOutline                    = 3;
  146.     hookTitle                    = 4;
  147.     hookItemList                = 5;
  148.     hookZoneTitle                = 6;
  149.     hookZoneList                = 7;
  150.     hookLine                    = 8;
  151.     hookVersion                    = 9;
  152.     hookReserved1                = 10;
  153.     hookReserved2                = 11;
  154.     hookReserved3                = 12;
  155.     hookReserved4                = 13;
  156. {    "virtual" hookProc items    }
  157.     hookNull                    = 100;
  158.     hookItemRefresh                = 101;
  159.     hookZoneRefresh                = 102;
  160.     hookEject                    = 103;
  161.     hookPreflight                = 104;
  162.     hookPostflight                = 105;
  163.     hookKeyBase                    = 1000;
  164.  
  165. {    NuLookup structures/constants    }
  166.  
  167. TYPE
  168.     NLTypeEntry = RECORD
  169.         hIcon:                    Handle;
  170.         typeStr:                Str32;
  171.     END;
  172.  
  173.     NLType = ARRAY [0..3] OF NLTypeEntry;
  174.  
  175.     NBPReply = RECORD
  176.         theEntity:                EntityName;
  177.         theAddr:                AddrBlock;
  178.     END;
  179.  
  180.     NameFilterProcPtr = ProcPtr;  { FUNCTION NameFilter((CONST)VAR theEntity: EntityName): INTEGER; }
  181.     NameFilterUPP = UniversalProcPtr;
  182.  
  183. CONST
  184.     uppNameFilterProcInfo = $000000E0; { FUNCTION (4 byte param): 2 byte result; }
  185.  
  186. FUNCTION NewNameFilterProc(userRoutine: NameFilterProcPtr): NameFilterUPP;
  187.     {$IFC NOT GENERATINGCFM }
  188.     INLINE $2E9F;
  189.     {$ENDC}
  190.  
  191. FUNCTION CallNameFilterProc(VAR theEntity: EntityName; userRoutine: NameFilterUPP): INTEGER;
  192.     {$IFC NOT GENERATINGCFM}
  193.     INLINE $205F, $4E90;
  194.     {$ENDC}
  195. TYPE
  196.     ZoneFilterProcPtr = ProcPtr;  { FUNCTION ZoneFilter(theZone: ConstStr32Param): INTEGER; }
  197.     ZoneFilterUPP = UniversalProcPtr;
  198.  
  199. CONST
  200.     uppZoneFilterProcInfo = $000000E0; { FUNCTION (4 byte param): 2 byte result; }
  201.  
  202. FUNCTION NewZoneFilterProc(userRoutine: ZoneFilterProcPtr): ZoneFilterUPP;
  203.     {$IFC NOT GENERATINGCFM }
  204.     INLINE $2E9F;
  205.     {$ENDC}
  206.  
  207. FUNCTION CallZoneFilterProc(theZone: ConstStr32Param; userRoutine: ZoneFilterUPP): INTEGER;
  208.     {$IFC NOT GENERATINGCFM}
  209.     INLINE $205F, $4E90;
  210.     {$ENDC}
  211.  
  212. FUNCTION InitCTBUtilities: CTBUErr;
  213. FUNCTION CTBGetCTBVersion: INTEGER;
  214. FUNCTION StandardNBP(where: Point; prompt: ConstStr255Param; numTypes: INTEGER; VAR typeList: NLType; nameFilter: NameFilterUPP; zoneFilter: ZoneFilterUPP; hook: DialogHookUPP; VAR theReply: NBPReply): INTEGER;
  215. FUNCTION CustomNBP(where: Point; prompt: ConstStr255Param; numTypes: INTEGER; VAR typeList: NLType; nameFilter: NameFilterUPP; zoneFilter: ZoneFilterUPP; hook: DialogHookUPP; userData: LONGINT; dialogID: INTEGER; filter: ModalFilterUPP; VAR theReply: NBPReply): INTEGER;
  216. {$IFC OLDROUTINENAMES }
  217. FUNCTION NuLookup(where: Point; prompt: ConstStr255Param; numTypes: INTEGER; VAR typeList: NLType; nameFilter: NameFilterUPP; zoneFilter: ZoneFilterUPP; hook: DialogHookUPP; VAR theReply: NBPReply): INTEGER;
  218. FUNCTION NuPLookup(where: Point; prompt: ConstStr255Param; numTypes: INTEGER; VAR typeList: NLType; nameFilter: NameFilterUPP; zoneFilter: ZoneFilterUPP; hook: DialogHookUPP; userData: LONGINT; dialogID: INTEGER; filter: ModalFilterUPP; VAR theReply: NBPReply): INTEGER;
  219. {$ENDC}
  220.  
  221. {$ALIGN RESET}
  222. {$POP}
  223.  
  224. {$SETC UsingIncludes := CTBUtilitiesIncludes}
  225.  
  226. {$ENDC} {__CTBUTILITIES__}
  227.  
  228. {$IFC NOT UsingIncludes}
  229.  END.
  230. {$ENDC}
  231.